<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function fn () {
      console.log(1111);
      // return 1111
      return new Promise((resolve, reject) => {
        resolve(2222)
      })
    }


    async function f1 () {
      // const res = await fn()  //语法糖   await  后面Promise
      const res = await fn()
      // const res1 = await axios()
      // axios().then(res1=>{
      //   console.log(res1);
      // })
      // fn.then(res => {
      //   console.log(res);
      // })
      // console.log(res, 999);
      // fn().then(res => {
      //   console.log(res, 999);
      // })
    }

    // console.log(f1(), 8888);
    f1()
  </script>
</body>

</html>